<extend name="public@:user_basics"/>
<block name="body">
	<div class="row-content am-cf">
		<div class="row am-cf">
			<div class="am-u-sm-12 am-u-md-5">
				<div class="widget am-cf" style="margin-bottom: 0;">
					<div class="widget-head am-cf">
						<div class="widget-title am-fl"><span class="am-icon-flag-checkered"></span>安全中心</div>
					</div>
					<form action="{:url('user/Profile/passwordPost')}" method="post" class="am-form tpl-form-line-form" id="formId">
						<div class="am-form-group">
							<label for="user-name" class="am-u-sm-3 am-form-label">旧密码 </label>
							<div class="am-u-sm-9">
								<input type="password" name="old_password" class="tpl-form-input" id="user-name" placeholder="旧密码">
							</div>
						</div>
						<div class="am-form-group">
							<label for="user-name" class="am-u-sm-3 am-form-label">新密码 </label>
							<div class="am-u-sm-9">
								<input type="password" name="password" class="tpl-form-input" id="user-name" placeholder="新密码">
							</div>
						</div>
						<div class="am-form-group">
							<label for="user-name" class="am-u-sm-3 am-form-label">再次输入 </label>
							<div class="am-u-sm-9">
								<input type="password" name="repassword" class="tpl-form-input" id="user-name" placeholder="确认新密码">
							</div>
						</div>
						<button class="am-btn am-btn-primary tpl-btn-bg-color-success bcsz" type="submit"><span class="am-icon-check-square-o"></span>保存设置</button>
					</form>
					<div class="widget-body-md widget-body tpl-amendment-echarts am-fr" id="tpl-echarts" style="display: none;">
					</div>
				</div>
			</div>
		</div>
	</div>
	<script>
		$(function () {
			$('#formId').submit(function () {
				$.post($(this).attr('action'),$(this).serialize(),function (da) {
					if(da.code == 0){
						sweetAlert(da.msg,'修改密码提示','error')
					}else{
						swal({
							title:da.msg
							,type:'success'
						}).then(function () {
							location.reload();
						})
					}
				})
				return false;
			})

		})
	</script>
</block>